<?
require("../connectDB.php");

if(is_uploaded_file($_FILES["upload2"]["tmp_name"])){
	$filename = iconv('UTF-8','TIS-620',$_FILES["upload2"]["name"]);
    move_uploaded_file($_FILES["upload2"]["tmp_name"], "../TheFile/Demo/".$filename);
}
if(is_uploaded_file($_FILES["upload1"]["tmp_name"])){
	$uploadname2=$_FILES["upload1"]["name"];
	$filename2 = iconv('UTF-8','TIS-620',$_FILES["upload1"]["name"]);
    move_uploaded_file($_FILES["upload1"]["tmp_name"], "../TheFile/MainFile/".$filename2);
}
else{
	$uploadname2 = "";
}
if(is_uploaded_file($_FILES["upload3"]["tmp_name"])){
	$uploadname3 = $_FILES["upload3"]["name"];
	$filename3 = iconv('UTF-8','TIS-620',$_FILES["upload3"]["name"]);
    move_uploaded_file($_FILES["upload3"]["tmp_name"], "../TheFile/Guide/".$filename3);
}
else{
	$uploadname3 = "";
}

$sql = "INSERT INTO project VALUES ('$uid', '', '$major', '$s_id', '$s_name', '$subject', '$upload_name', '$select_status', sysdate(), '$mail', '$s_teacher', '$facebok', '$comment', '$filename2', '".$_FILES["upload2"]["name"]."', '$filename3', '', '$select_type')";

mysql_query($sql);

mysql_close($con);
?>
<meta http-equiv ="refresh" content="0;url=Home_Admin.php">